
<%
	/**
	 购物车信息确认处理
	 **/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>购物车信息查看</title>
		<link rel="stylesheet" href="/safeai/css/safeai/customeViewStyle.css"
			type="text/css" />
		<link rel="stylesheet"
			href="/safeai/css/safeai/customeInfoListStyle.css" type="text/css" />
		<%@ include file="/pages/safeai/view/common/taglib.jsp"%>
	</head>
	<body>
		<%@ include file="/pages/safeai/view/common/head.jsp"%>


		<DIV class=block>
			<DIV id=log class=CartWrap>
				<DIV class="CartNav clearfix">
					<DIV class=floatLeft>
						<IMG alt=购物流程--确认订单填写购物信息
							src="${ctx }/images/safeai/chargecart/cartnav-step3.gif">
					</DIV>
					<DIV class=floatRight>
						<IMG src="${ctx }/images/safeai/chargecart/cartnav-cart.gif">
					</DIV>
				</DIV>
				<FORM id=order-create method=post action="${ctx }/order/submitOrder.do" name="order-create"
					extra="subOrder">
					<INPUT id=payment[zzhkname] type=hidden name=payment[zzhkname]>
					<input type="hidden" name="m" value="addOrder">
					<DIV style="DISPLAY: none">
						<INPUT class="x-input " type=text vtype="checkForm"
							autocomplete="off">
					</DIV>
					<DIV class="FormWrap checkoutbase">
						<TABLE cellSpacing=0 cellPadding=0 width="100%">
							<TBODY>
								<TR>
									<TD style="WHITE-SPACE: nowrap; VERTICAL-ALIGN: middle"
										width=100>
										<H3>
											收货信息确认
										</H3>
									</TD>
									<TD>
										<DIV id=receiver class="division receiver">
										<logic:present name="memberAddress" >
											<UL class="list receiver-sel">
												<logic:iterate id="addressMap" name="memberAddress">
													<LI>
														<INPUT value="${addressMap.oid }" CHECKED type=radio
														    id="delivery[addr_id]${addressMap.oid }"
															name=delivery[addr_id] onclick="addressRadioClick(this);">
														
													    <input type="hidden" name="phone${addressMap.oid }" 
														     value='${addressMap.phone }' id="phone${addressMap.oid }">
													    <input type="hidden" name="mobile${addressMap.oid }" 
														     value='${addressMap.mobile }' id="mobile${addressMap.oid }">
														<input type="hidden" name="consignee${addressMap.oid }" 
														     value='${addressMap.consignee }' id="consignee${addressMap.oid }">
														<input type="hidden" name="address${addressMap.oid }" 
														     value='${addressMap.address }' id="address${addressMap.oid }">
													    <input type="hidden" name="city${addressMap.oid }" 
														     value='${addressMap.city }' id="city${addressMap.oid }"> 
														<input type="hidden" name="postcode${addressMap.oid }" 
														     value='${addressMap.postcode }' id="postcode${addressMap.oid }"> 
													    <input type="hidden" name="email${addressMap.oid }" 
														     value='${addressMap.email }' id="email${addressMap.oid }"> 
														     
														<input type="hidden" name="delivery[addr_info]${addressMap.oid }" 
														     value='${addressMap.address }(收货人：${addressMap.consignee })'
														     id="delivery[addr_info]${addressMap.oid }">
														${addressMap.address }(收货人：${addressMap.consignee }
														电话：${addressMap.mobile } /手机 ：${addressMap.phone }
														邮编：${addressMap.postcode }) &nbsp;
														<A class="lnk addredit" href="javascript:void(0)" onclick="editAddressClick('${addressMap.oid }');">编辑</A>
													</LI>
												</logic:iterate>
												<LI>
													<INPUT value=0 type=radio name=delivery[addr_id] onclick="addressRadioClick(this);">
													其他收货地址
												</LI>
											</UL>
											<DIV id=checkout-recaddr style='display:none'>
												<TABLE class="liststyle data" border=0 cellSpacing=0
													cellPadding=0 widtd="100%">
													<COLGROUP>
														<COL class=span-3>
														<COL class=span-9>
														<COL class=span-auto>
													<TBODY>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货地区：
															</TD>
															<TD colSpan=2>
																<SPAN id=checkout-select-area><SPAN
																	class="span _x_ipt" vtype="area" package="mainland"><INPUT
																			id=shipping-area type=hidden name=delivery[ship_area]>
																		<SELECT onchange=selectArea(this,this.value,2)>
																			<OPTION selected value=_NULL_>
																				请选择...
																			</OPTION>
																			<OPTION value=1 has_c="true">
																				北京
																			</OPTION>
																		</SELECT> </SPAN> </SPAN>
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货地址：
															</TD>
															<TD>
																<INPUT id=selected-area-hidden type=hidden
																	name=delivery[ship_addr_area]>
																<SPAN id=selected-area class=fontcolorGray
																	title=系统将拼接地区选择结果到收获地址>[地区]</SPAN>
																<INPUT id="delivery[ship_address]" class="x-input inputstyle" size=30
																	type=text name='address' vtype="required"
																	autocomplete="off">
															</TD>
															<TD>
																邮编：
																<INPUT id='delivery[ship_postcode]' class="x-input inputstyle span-2" size=30
																	type=text name='postcode' vtype="text"
																	autocomplete="off">
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货人姓名：
															</TD>
															<TD colSpan=2>
																<INPUT id="delivery[ship_name]" class="x-input inputstyle" size=30
																	type=text name='consignee' vtype="text" 
																	autocomplete="off" required="true">
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>手机：
															</TD>
															<TD colSpan=2>
																<INPUT id='delivery[ship_phone]' class="x-input inputstyle" size=30
																	type=text name='phone' vtype="text"
																	autocomplete="off">
															</TD>
															
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: #ccc">*</EM>固定电话：
															</TD>
															<TD colSpan=2>
																<INPUT id='delivery[ship_mobile]' class="x-input inputstyle" size=30
																	type=text name='mobile' vtype="text"
																	autocomplete="off">
															</TD>
															
														</TR>
														<TR class=recsave>
															<TD>
																是否保存地址：
															</TD>
															<TD colSpan=2>
																<LABEL>
																	<INPUT value=1 CHECKED type=checkbox id="delivery[is_save]"
																		name="is_save">
																	保存本次收货地址
																</LABEL>
															</TD>
														</TR>
													</TBODY>
												</TABLE>
											</DIV>
										</logic:present>
										<logic:notPresent name="memberAddress" >
										
											<DIV id=checkout-recaddr >
												<TABLE class="liststyle data" border=0 cellSpacing=0
													cellPadding=0 widtd="100%">
													<COLGROUP>
														<COL class=span-3>
														<COL class=span-9>
														<COL class=span-auto>
													<TBODY>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货地区：
															</TD>
															<TD colSpan=2>
																<SPAN id=checkout-select-area><SPAN
																	class="span _x_ipt" vtype="area" package="mainland"><INPUT
																			id=shipping-area type=hidden name=delivery[ship_area]>
																		<SELECT onchange=selectArea(this,this.value,2)>
																			<OPTION selected value=_NULL_>
																				请选择...
																			</OPTION>
																			<OPTION value=1 has_c="true">
																				北京
																			</OPTION>
																		</SELECT> </SPAN> </SPAN>
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货地址：
															</TD>
															<TD>
																<INPUT id=selected-area-hidden type=hidden
																	name=delivery[ship_addr_area]>
																<SPAN id=selected-area class=fontcolorGray
																	title=系统将拼接地区选择结果到收获地址>[地区]</SPAN>
																<INPUT id="delivery[ship_address]" class="x-input inputstyle" size=30
																	type=text name='address' vtype="required"
																	autocomplete="off">
															</TD>
															<TD>
																邮编：
																<INPUT id='delivery[ship_postcode]' class="x-input inputstyle span-2" size=30
																	type=text name='postcode' vtype="text"
																	autocomplete="off">
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>收货人姓名：
															</TD>
															<TD colSpan=2>
																<INPUT id="delivery[ship_name]" class="x-input inputstyle" size=30
																	type=text name='consignee' vtype="text" 
																	autocomplete="off" required="true">
															</TD>
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: red">*</EM>手机：
															</TD>
															<TD colSpan=2>
																<INPUT id='delivery[ship_phone]' class="x-input inputstyle" size=30
																	type=text name='phone' vtype="text"
																	autocomplete="off">
															</TD>
															
														</TR>
														<TR>
															<TD>
																<EM style="COLOR: #ccc">*</EM>固定电话：
															</TD>
															<TD colSpan=2>
																<INPUT id='delivery[ship_mobile]' class="x-input inputstyle" size=30
																	type=text name='mobile' vtype="text"
																	autocomplete="off">
															</TD>
															
														</TR>
														<TR class=recsave>
															<TD>
																是否保存地址：
															</TD>
															<TD colSpan=2>
																<LABEL>
																	<INPUT value=1 CHECKED type=checkbox
																		name=delivery[is_save]>
																	保存本次收货地址
																</LABEL>
															</TD>
															<TD >
																<div
																	style="width: 200px;height:40px; float: right; padding-right: 5px;">
																	<div style="white-space: nowrap;">
																		<INPUT class="actbtn_chargeCart btn-login" tabIndex=4
																			value=登录 type=submit>
																		<INPUT style="padding-left: 20px;"
																			class="actbtn_chargeCart btn-register" value=注册新用户
																			type=submit>
																	</div>
																</div>
															</TD>
														</TR>
													</TBODY>
												</TABLE>
											</DIV>
										</logic:notPresent>
											<DIV
												style="PADDING-BOTTOM: 5px; MARGIN-TOP: 4px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px"
												class=receivermore>
												订单附言：
												<INPUT style="WIDTH: 400px" class="x-input inputstyle"
													type=text name=delivery[memo] vtype="text"
													autocomplete="off">
												指定送货时间:
												<INPUT
													onclick='$(this).getNext("div")[this.checked?"show":"hide"]();'
													type=checkbox>
												<DIV style="MARGIN-TOP: 4px; DISPLAY: none">
													送货时间：
													<SELECT class=inputstyle name=delivery[day]>
														<OPTION selected value=任意日期>
															任意日期
														</OPTION>
														<OPTION value=仅工作日>
															仅工作日
														</OPTION>
														<OPTION value=仅休息日>
															仅休息日
														</OPTION>
														<OPTION value=specal>
															指定日期
														</OPTION>
													</SELECT>
													&nbsp;
													<SPAN style="DISPLAY: none" id=specal_day><INPUT
															style="WIDTH: 80px" class="x-input cal inputstyle"
															value=2011-10-17 readOnly type=text
															name=delivery[specal_day] vtype="text" autocomplete="off"
															real="1"> </SPAN>
													<SELECT class=inputstyle name=delivery[time]>
														<OPTION selected value=任意时间段>
															任意时间段
														</OPTION>
														<OPTION value=上午>
															上午
														</OPTION>
														<OPTION value=下午>
															下午
														</OPTION>
														<OPTION value=晚上>
															晚上
														</OPTION>
													</SELECT>
												</DIV>
											</DIV>
										</DIV>

									</TD>
								</TR>
							</TBODY>
						</TABLE>
						<TABLE cellSpacing=0 cellPadding=0 width="100%">
							<TBODY>
								<TR>
									<TD style="WHITE-SPACE: nowrap; VERTICAL-ALIGN: middle"
										width=100>
										<H3>
											配送方式确认
											<EM style="COLOR: red">*</EM>
										</H3>
									</TD>
									<TD>
										<DIV id=shipping class=division>
											<DIV class="valierror clearfix">
												请先完善收货信息.
											</DIV>
										</DIV>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
						<TABLE cellSpacing=0 cellPadding=0 width="100%">
							<TBODY>
								<TR>
									<TD style="WHITE-SPACE: nowrap; VERTICAL-ALIGN: middle"
										width=100>
										<H3>
											支付方式确认
											<EM style="COLOR: red">*</EM>
										</H3>
									</TD>
									<TD>
										<DIV class=division>
											<DIV
												style="PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px"
												id=_payment_currency>
												货币类型：
												<SELECT id=payment-cur
													class="x-input-select inputstyle inputstyle"
													name=payment[currency] required="true">
													<OPTION selected value=CNY>
														人民币
													</OPTION>
												</SELECT>
											</DIV>
											<DIV id=payment>
												<TABLE style="DISPLAY: none" id=_pay_cod
													class="liststyle data" cellSpacing=0 cellPadding=0
													width="100%">
													<COLGROUP>
														<COL class="span-5 ColColorGray"></COL>
														<COL class=span-auto></COL>
													<TBODY>
														<TR>
															<TH style="TEXT-ALIGN: left">
																<INPUT id=payment_bank class=x-payMethod value=-1
																	type=radio name=payment[payment] paytype="offline">
																<STRONG>货到付款</STRONG>
															</TH>
															<TD>
																由我们的快递人员在将货物送到时收取货款。
															</TD>
														</TR>
													</TBODY>
												</TABLE>

											</DIV>
										</DIV>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
					</DIV>

					<DIV class=FormWrap>
						<H3>
							购买的商品
						</H3>
						<DIV class=division>
							<TABLE class=liststyle cellSpacing=0 cellPadding=0 width="100%">
								<COLGROUP>
									<COL class=span-auto></COL>
									<COL class="span-auto textleft"></COL>
									<COL class=span-2></COL>
									<COL class=span-2></COL>
									<COL class=span-2></COL>
									<COL class=span-1></COL>
									<COL class="span-2 ColColorOrange"></COL>
								<THEAD>
									<TR>
										<TH>
											图片
										</TH>
										<TH class=product>
											商品名称
										</TH>
										<TH class=price>
											积分
										</TH>
										<TH class=price>
											销售价格
										</TH>
										<TH class=number>
											优惠价格
										</TH>
										<TH class=number>
											数量
										</TH>
										<TH class=price>
											小计
										</TH>
									</TR>
								</THEAD>
								<TBODY>
								<logic:present name="ShoppingCart" scope="session">
											<!--循环购物车数据-->
											<logic:iterate id="sc" name="ShoppingCart">
												<input type="hidden" name="freeDeliver"
													value="${sc.value.freeDeliver}" />
												<input type="hidden" name="taxPrice"
													value="${sc.value.taxPrice}" />
												<input type="hidden" name="price" value="${sc.value.price}" />
												<input type="hidden" name="getPoint"
													value="${sc.value.getPoint}" />
												<form action="${ctx}/shopping/viewShoppingCart.do"
													id="${sc.key}form" method="post">
													<span style="margin-top: 15px"> <label
															style="width: 80px; height: 20px;">
															<input type="hidden" name="m" value="updateNumForward"
																style="width: 0; height: 0; line-height: 0;" />
															<input type="hidden" name="id" value="${sc.key}"
																style="width: 0; height: 0; line-height: 0;" />
															<input type="hidden" name="hiddquantity"
																value="${sc.value.quantity}"
																style="width: 0; height: 0; line-height: 0;" />
												</form>

												<TR price="${sc.value.price}"
													urlremove="?cart-g-removeCart.html"
													urlupdate="?cart-g-10154@7825@3273_0_1|-updateCart.html"
													number="1">
													<TD>
														<DIV style="WIDTH: 50px; HEIGHT: 50px"
															class=cart-product-img ghref="?product-10154.html"
															isrc="${ctx }/product_image/${sc.value.id}/${sc.value.id}_1_l_1_50X50.jpg">
															<A
																style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px"
																href="${ctx }/product/productMessage.do?method=shopDeatails&id=${sc.value.id}" target=_blank><IMG
																	style="CURSOR: pointer"
																	src="${ctx }/product_image/${sc.value.id}/${sc.value.id}_1_l_1_50X50.jpg"
																	width=50 height=50> </A>
														</DIV>
													</TD>
													<TD style="TEXT-ALIGN: left">
														<a
															href="${ctx}/product/productMessage.do?method=shopDeatails&id=${sc.value.id}"
															target="_blank" class="text_ad"> ${sc.value.pname}</a>
													</TD>
													<TD>
														${sc.value.point}
													</TD>
													<TD class=" mktprice1">
														￥${sc.value.price}
													</TD>
													<TD>
														￥${sc.value.price}
													</TD>
													<TD>
														${sc.value.quantity}
													</TD>
													<TD class="itemTotal fontcolorRed">
														￥${sc.value.sum}
													</TD>
												</TR>

											</logic:iterate>

											<logic:iterate id="frees" name="free" scope="session">
												<TR price="${frees.value.price}"
													urlremove="?cart-g-removeCart.html"
													urlupdate="?cart-g-10154@7825@3273_0_1|-updateCart.html"
													number="1">
													<TD>
														<DIV style="WIDTH: 50px; HEIGHT: 50px"
															class=cart-product-img ghref="?product-10154.html"
															isrc="${ctx }/product_image/${frees.value.id}/${frees.value.id}_1_l_1_50X50.jpg">
															<A
																style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px"
																href="${ctx }/product/productMessage.do?method=shopDeatails&id=${frees.value.id}" target=_blank><IMG
																	style="CURSOR: pointer"
																	src="${ctx }/product_image/${frees.value.id}/${frees.value.id}_1_l_1_50X50.jpg"
																	width=50 height=50> </A>
														</DIV>
													</TD>
													<TD style="TEXT-ALIGN: left">
														<a
															href="${ctx}/product/productMessage.do?method=shopDeatails&id=${frees.value.id}"
															target="_blank" class="text_ad"> ${frees.value.pname}</a>
													</TD>
													<TD>
														赠品
													</TD>
													<TD class=" mktprice1">
														￥${frees.value.price}
													</TD>
													<TD>
														---
													</TD>
													<TD>
														<DIV class=Numinput>
															${frees.value.quantity}
														</DIV>
													</TD>
													<TD class="itemTotal fontcolorRed">
														---
													</TD>
												</TR>
											</logic:iterate>
										</logic:present>
									</TBODY>
								</TABLE>
								</TBODY>
							</TABLE>
						</DIV>
					</DIV>
					<DIV id=amountInfo>
						<DIV class=clearfix>
							<TABLE class="liststyle data" cellSpacing=0 cellPadding=0
								width="100%">
								<COLGROUP>
									<COL class="span-auto ColColorGray"></COL>
									<COL class="span-4 ColColorOrange textright"></COL>
								<TBODY>
									<TR>
										<TH>
											商品总价格：
										</TH>
										<TD class=price value="2299">
											￥${ TOTAL_SHOPPING_CART_PRICE}
										</TD>
									</TR>
									<TR>
										<TH>
											此订单数获得积分：
										</TH>
										<TD>
											${ TOTAL_SHOPPING_CART_POINT}
										</TD>
									</TR>
									<TR>
										<TH>
											您的积分总计：
										</TH>
										<TD>
											22
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</DIV>
					</DIV>
					<DIV class="CartBtn clearfix">
						<INPUT value=true type=hidden name=fromCart>
						<DIV class=span-auto>
							<INPUT class="actbtn btn-return-checkout"
								onclick="window.location='/safeai/shopping/viewShoppingCart.do?m=show&id=4';" value=返回购物车
								type=button>
						</DIV>
						<DIV class="span-auto floatRight last">
							<INPUT id=order_ct_dgc class="actbtn btn-confirm" value=确认无误，下订单 onclick="checkAddressInfo();"
								type=button>
						</DIV>
					</DIV>
				</FORM>
			</DIV>

		</DIV>
<script type='text/javascript' src='${ctx }/js/safeai/Ajax.js'></script>
<script>
/**
检查地址信息是否正确
**/
function checkAddressInfo(){
	var lstAddressRadios = document.getElementsByName('delivery[addr_id]');
	if(lstAddressRadios.length>0){
		var iLength = lstAddressRadios.length;
		var strSelectValue = "";
		var strAddressId = "delivery[addr_info]";
		for(var i = 0 ;i < iLength;i++){
			if(lstAddressRadios[i].checked){
			     strSelectValue = lstAddressRadios[i].value;
			     if(strSelectValue != '0'){
			         strAddressId = strAddressId+strSelectValue;
			         if(confirm('请确认收货信息：'+document.getElementById(strAddressId).value)){
			            submitOrderinfo();
			         }
			      }else{
			         var strShipAddr = document.getElementById('delivery[ship_address]').value;
			         var strShipName = document.getElementById('delivery[ship_name]').value;
			         var strPhone = document.getElementById('delivery[ship_phone]').value;
			         if(strShipAddr == '' || strShipName== '' || strPhone == ''){
				         MessageBox.show("请填写相关的收货信息，以便您能收到您购买的宝贝!",{delay:3});
			         }else{
			         	if(confirm('请确认收货信息：'+strShipAddr+'(收货人：'+strShipName+')')){
			         	  submitOrderinfo();
			         	}
			         }
			      }
			}
		}
	}else{
		var strShipAddr = document.getElementById('delivery[ship_address]').value;
        var strShipName = document.getElementById('delivery[ship_name]').value;
        var strPhone = document.getElementById('delivery[ship_phone]').value;
	    if(strShipAddr == '' || strShipName== '' || strPhone == ''){
	         MessageBox.show("请填写相关的收货信息，以便您能收到您购买的宝贝!",{delay:3});
         }else{
         	if(confirm('请确认收货信息：'+strShipAddr+'(收货人：'+strShipName+')')){
         	  submitOrderinfo();
         	}
         }
	}
}
//提交订单信息
function submitOrderinfo(){
  document.forms['order-create'].submit();
}
/**
地址选择改变处理
**/
function addressRadioClick(objRadio){
     var _value=objRadio.value;
      if(_value!='0'){
         jQuery('#checkout-recaddr').hide('slow');
      }else{
         jQuery('#checkout-recaddr').show('slow');
      }
      currentAddressChange(_value);
}
//编辑收货地址
function editAddressClick(editId){
   document.getElementById('delivery[addr_id]'+editId).checked = true;
   jQuery('#checkout-recaddr').show('slow');
   currentAddressChange(editId);
}
//当前地址选择修改
function currentAddressChange(addrId){
  valueChange('delivery[ship_address]','address'+addrId);
  valueChange('delivery[ship_postcode]','postcode'+addrId);
  valueChange('delivery[ship_name]','consignee'+addrId);
  valueChange('delivery[ship_phone]','phone'+addrId);
  valueChange('delivery[ship_mobile]','mobile'+addrId);
}
//页面值赋值处理
function valueChange(goalId,originId){
	var objGoal = document.getElementById(goalId);
	var objOrigin = document.getElementById(originId);
	if(objGoal){
		if(objOrigin){
		    objGoal.value = objOrigin.value;
		}else{
		   objGoal.value = "";
		}
	}
}
</script>
		<div class="clear"></div>
		<%@ include file="/pages/safeai/view/common/foot.jsp"%>
	</body>
</html>